package org.bonorsoft.modules.wechat.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.bonorsoft.modules.wechat.entity.NywxTj;

import java.util.List;

public interface NywxTjMapper extends BaseMapper<NywxTj> {

    @Select("SELECT tjid, nywxbt, nywxnr, tjrid, tjrxm, tjsj, nywxlb " +
            "FROM nywx_tj " +
            "WHERE nywxlb = '0' ")
    List<NywxTj> iHaveList();

    @Select("SELECT tjid, nywxbt, nywxnr, tjrid, tjrxm, tjsj, nywxlb " +
            "FROM nywx_tj " +
            "WHERE nywxlb = '1' ")
    List<NywxTj> iNeedList();

    @Select("SELECT tjid, nywxbt, nywxnr, tjrid, tjrxm, tjsj, nywxlb " +
            "FROM nywx_tj ${ew.customSqlSegment} ")
    IPage<NywxTj> paging(Page<NywxTj> page, @Param(Constants.WRAPPER) QueryWrapper<NywxTj> queryWrapper);
}
